<template>
  <page-container>
    <a-card :bordered="false" style="margin-top:24px">
      <div style="display: flex">
        <div class="ant-descriptions-title">对账单</div>
        <!--<span class="table-page-search-submitButtons" style="margin-left: 30px">
          <a-button type="primary" @click="getData(1)" >本月</a-button>
          <a-button type="primary" @click="getData(2)" >上月</a-button>
        </span>-->
      </div>
      <div class="table-page-search-wrapper">
        <s-table
          ref="table"
          size="default"
          rowKey="id"
          :columns="columns"
          :data="loadData"
          :pagination="pagination"
        >
          <template slot="head_img" slot-scope="text">
            <a-avatar shape="square" :size="32" icon="user" :src="text" />
          </template>
          <template slot="actions" slot-scope="text, record">
            <a @click="handleDetail(record)">详情</a>
          </template>
        </s-table>
      </div>
    </a-card>
    <!--<StewardWalletShowTable />-->
  </page-container>
</template>

<script>
import { billList,billShow } from '@/api/stat'
import formTableMixin from '@/mixins/formTableMixin'
import statInfo from '@/components/stat-info/stat-info'
import StewardWalletShowTable from './modules/StewardWalletShowTable.vue'
import pick from 'lodash.pick'
import {housePriceList} from "@/api/house";

const columns = [
  {
    title: '总单量',
    dataIndex: 'total_order'
  },
  {
    title: '总金额',
    dataIndex: 'total_money'
  },
  {
    title: '线上总单量',
    dataIndex: 'online_order'
  },
  {
    title: '线上总金额',
    dataIndex: 'online_money'
  },
  {
    title: '线下总单量',
    dataIndex: 'wash_order'
  },
  {
    title: '线下总金额',
    dataIndex: 'wash_money'
  },
  {
    title: '抖音总单量',
    dataIndex: 'douyin_order'
  },
  {
    title: '抖音总金额',
    dataIndex: 'douyin_money'
  },
  {
    title: '乐管家分享总单量',
    dataIndex: 'share_order'
  },
  {
    title: '乐管家分享总金额',
    dataIndex: 'share_money'
  },
  {
    title: '乐管家推广总单量',
    dataIndex: 'from_order'
  },
  {
    title: '乐管家推广总金额',
    dataIndex: 'from_money'
  },
  {
    title: '结算价格',
    dataIndex: 'settlement_money'
  },
  /*{
    title: '操作',
    dataIndex: 'actions',
    width: '150px',
    scopedSlots: { customRender: 'actions' }
  }*/
]

export default {
  name: 'ProviderWallet',
  mixins: [formTableMixin],
  components: {
    statInfo,
    StewardWalletShowTable
  },
  data () {
    this.columns = columns
    return {
      type: 1
    }
  },
  created () {
    this.getData(1)
  },
  methods: {
    getData(i){
      this.type=i
      if(this.type===1){
        console.log(111111)
        this.listAction = billList
      }else{

        console.log(2222)
        this.listAction = parameter =>
          billShow({store_id: 1}).then(res => {
            return res
          })
      }
    }
  }
}
</script>
